require "test/unit"
$:.unshift File.dirname(__FILE__) + '/../lib'

require 'Eyealike'

class CollectionTestCase < Test::Unit::TestCase
  
  
  
  def test_security_header_population
    
    client = Eyealike.new("V5VF5X79W1OCW6KQBGOM", "kQWhIzEHZjXeAfQozfcb7/AVtmZYjL7rTGIpm+J/", false, "localhost:8081")
        
    assert_not_nil(client, message = "Client initialization failed")
    
    request_date = client.generate_request_date
    
    assert_not_nil(request_date)
    puts request_date
    
    service_id = "test-service-id"
    urls = [ "http://test.eyealike.com/img1.jpeg", "http://test.eyealike.com/img2.jpeg"]
    rois = [ "asdfasdfasdfasdfasdfasdf", "sdfasdfd98843-asdfasdf"]
    collection_ids = ["asdfasdfasdfasdfadsf", "adfasdfasdfasdfasdfads"]
   
    signable_msg = client.generate_signable_message(service_id, request_date, urls, rois, collection_ids)
    
    assert_not_nil(signable_msg)
    
    puts signable_msg
    
    sig = client.create_signature(signable_msg)
    
    assert_not_nil(sig)
    
    puts sig
   
  end
end